using System.Collections.Generic;
using com.tc.util;

namespace com.tc.zigbee.mt.income
{
    public class ActiveEndpointResponse : IncomeMessage
    {
        public short getSrcAddress()
        {
            return srcAddress;
        }
        public List<byte> getEndpoints()
        {
            return endpoints;
        }
        public ActiveEndpointResponse(byte[] data)
        {
            byte[] na = new byte[2];
            na[0] = data[0];
            na[1] = data[1];
            srcAddress = DataUtil.shortValue(na);
            status = data[2];
            na[0] = data[3];
            na[1] = data[4];


            nwkAddress = DataUtil.shortValue(na);

            activeEPCount = data[5];

            for (int i = 0; i < activeEPCount; i++)
            {

                endpoints.Add(data[6 + i]);

            }

        }

        //Length = 0x06-0x53  Cmd0 = 0x45  Cmd1 = 0x85  SrcAddr  Status  NwkAddr  ActiveEPCount ActiveEPList  
        byte status;

        short nwkAddress;
        short srcAddress;
        byte activeEPCount;
        List<byte> endpoints = new List<byte>();

        public byte getStatus()
        {
            return status;
        }
        public short getNwkAddress()
        {
            return nwkAddress;
        }


    }
}